const express = require('express');
const cors = require('cors');
const path = require('path');
const app = express();
app.listen(3000,()=>{console.log('玩命加载');
})
// 配置跨域中间件
app.use(cors());
app.use(express.urlencoded({extended:false}));
// 加载路由
let books = require('./routers/books');
app.use('/api',books);